Skip to content

fix: return after resolve in wipeCollectorStorage guards - #6671

Merged
timothycarambat merged 2 commits into
Mintplex-Labs:masterfrom
moneebullah25:fix/collector-wipe-storage-missing-dir
Oct 9, 2026
Merged

timothycarambat merged 2 commits into
Mintplex-Labs:masterfrom
moneebullah25:fix/collector-wipe-storage-missing-dir

Conversation

@moneebullah25

@moneebullah25 moneebullah25 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request Type

  • ✨ feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #6669

Description

wipeCollectorStorage called resolve() in its guards (missing hotdir, readdir error on hotdir, readdir error on storage/tmp) without returning. Execution then fell through to for (const file of files) with files undefined, throwing TypeError: files is not iterable inside the readdir callback. That is an uncaught exception, so the collector crashed at boot when the hotdir or storage/tmp was missing.

The guards now return resolve(), so boot continues.

Additional Information

The fs.rmSync call without recursive is untouched and out of scope here.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

Collector yarn lint:check passes and yarn test collector passes (14 suites, 408 tests).

@shatfield4 shatfield4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shatfield4 shatfield4 added the PR:Ready-to-merge PR has been reviewed by core team and is ready to merge label Oct 8, 2026
@timothycarambat
timothycarambat merged commit 2dc2347 into Mintplex-Labs:master Oct 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:Ready-to-merge PR has been reviewed by core team and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: collector crashes at startup in wipeCollectorStorage when hotdir or storage/tmp is missing (missing return after resolve)

3 participants